//
//  ITUserManager.h
//  InTubePro
//
//  Created by seven on 2019/12/19.
//  Copyright © 2019 seven. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ITUserInfo.h"
//#import "ITLoginViewController.h"
#import "ITDeviceInfo.h"

#define DeviceTokenService @"com.client.videochat.deviceTokenService"
#define DeviceTokenAccount @"com.client.videochat.deviceTokenAccount"

#define ActiveDeviceTime @"ActiveDeviceTime"
#define HostProfilePlist @"PersonProfile.plist"

#define KMY_AutoLogin @"IsAutoLogin"

#define DayNotificationKey @"DayNotificationKey"

NS_ASSUME_NONNULL_BEGIN

typedef void (^ActiveCallBack)(ITUserInfo *member);

@interface ITUserManager : NSObject

@property(nonatomic, strong)ITUserInfo *member;

IT_PROPERTY_ASSIGN BOOL dayNotificationOn;

+ (instancetype)shareManager;

/**激活设备 创建匿名用户*/
- (void)activeDevice:(ActiveCallBack)callback;

+ (NSString *)token;

+ (ITUserInfo *)currentMember;

-(void)getMemberInfo:(void (^)(ITUserInfo *member, id ret))callback;

- (void)updateMember:(ITUserInfo *)member;

/** app登录成功时处理事件 */
- (void)loginSuccess:(ITUserInfo *)member;

/**app退出登录时处理事件 */
- (void)loginout;

/** 验证登录状态 */
- (ITUserInfo * IT_NULLABLE)verifyLoginStatus;

/** 验证登录状态 未登录弹出登录页面 */
- (BOOL)verifyLoginWithCompletion:(VerifyLoginBlock)completion;

/**取消登录*/
- (void)cancelLogin;

/** 设备唯一标识*/
- (NSString *)getDeviceToken;

/** 统计数据处理*/
-(NSDictionary *)trackDictionaryWithEventNo:(NSString *)eventNo parameters:(NSDictionary *)parameters;

/** 移除本地用户数据*/
- (void)removeLocalHostMemberData;


-(void)sendRegID:(NSString *)regId channel:(NSString *)channel;

@end

NS_ASSUME_NONNULL_END
